package com.dgw.config;

import com.dgw.servlet.HelloServlet;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.Servlet;

/**
 * @program: spring-boot-web-restfulcrud
 * @description:
 * @author: Mr.Dai
 * @create: 2019-12-04 17:34
 **/
@Configuration
public class ServletConfig {
    @Bean
    public ServletRegistrationBean registrationBean(){
        ServletRegistrationBean<Servlet> servletServletRegistrationBean = new ServletRegistrationBean<>();
        servletServletRegistrationBean.setServlet(new HelloServlet());
        servletServletRegistrationBean.addUrlMappings("/HelloServlet");
        return servletServletRegistrationBean;
    }
}
